Optimal. Leaf size=155 \[ \frac {(e+f x)^3 \left (a+b \tan ^{-1}(c+d x)\right )}{3 f}-\frac {b \left (-\left (1-3 c^2\right ) f^2-6 c d e f+3 d^2 e^2\right ) \log \left ((c+d x)^2+1\right )}{6 d^3}-\frac {b (d e-c f) \left (-\left (3-c^2\right ) f^2-2 c d e f+d^2 e^2\right ) \tan ^{-1}(c+d x)}{3 d^3 f}-\frac {b f^2 (c+d x)^2}{6 d^3}-\frac {b f x (d e-c f)}{d^2} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.19, antiderivative size = 155, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 6, integrand size = 18, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {5047, 4862, 702, 635, 203, 260} \[ \frac {(e+f x)^3 \left (a+b \tan ^{-1}(c+d x)\right )}{3 f}-\frac {b \left (-\left (1-3 c^2\right ) f^2-6 c d e f+3 d^2 e^2\right ) \log \left ((c+d x)^2+1\right )}{6 d^3}-\frac {b (d e-c f) \left (-\left (3-c^2\right ) f^2-2 c d e f+d^2 e^2\right ) \tan ^{-1}(c+d x)}{3 d^3 f}-\frac {b f x (d e-c f)}{d^2}-\frac {b f^2 (c+d x)^2}{6 d^3} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 203
Rule 260
Rule 635
Rule 702
Rule 4862
Rule 5047
Rubi steps
\begin {align*} \int (e+f x)^2 \left (a+b \tan ^{-1}(c+d x)\right ) \, dx &=\frac {\operatorname {Subst}\left (\int \left (\frac {d e-c f}{d}+\frac {f x}{d}\right )^2 \left (a+b \tan ^{-1}(x)\right ) \, dx,x,c+d x\right )}{d}\\ &=\frac {(e+f x)^3 \left (a+b \tan ^{-1}(c+d x)\right )}{3 f}-\frac {b \operatorname {Subst}\left (\int \frac {\left (\frac {d e-c f}{d}+\frac {f x}{d}\right )^3}{1+x^2} \, dx,x,c+d x\right )}{3 f}\\ &=\frac {(e+f x)^3 \left (a+b \tan ^{-1}(c+d x)\right )}{3 f}-\frac {b \operatorname {Subst}\left (\int \left (\frac {3 f^2 (d e-c f)}{d^3}+\frac {f^3 x}{d^3}+\frac {(d e-c f) \left (d^2 e^2-2 c d e f-3 f^2+c^2 f^2\right )+f \left (3 d^2 e^2-6 c d e f-\left (1-3 c^2\right ) f^2\right ) x}{d^3 \left (1+x^2\right )}\right ) \, dx,x,c+d x\right )}{3 f}\\ &=-\frac {b f (d e-c f) x}{d^2}-\frac {b f^2 (c+d x)^2}{6 d^3}+\frac {(e+f x)^3 \left (a+b \tan ^{-1}(c+d x)\right )}{3 f}-\frac {b \operatorname {Subst}\left (\int \frac {(d e-c f) \left (d^2 e^2-2 c d e f-3 f^2+c^2 f^2\right )+f \left (3 d^2 e^2-6 c d e f-\left (1-3 c^2\right ) f^2\right ) x}{1+x^2} \, dx,x,c+d x\right )}{3 d^3 f}\\ &=-\frac {b f (d e-c f) x}{d^2}-\frac {b f^2 (c+d x)^2}{6 d^3}+\frac {(e+f x)^3 \left (a+b \tan ^{-1}(c+d x)\right )}{3 f}-\frac {\left (b \left (3 d^2 e^2-6 c d e f-\left (1-3 c^2\right ) f^2\right )\right ) \operatorname {Subst}\left (\int \frac {x}{1+x^2} \, dx,x,c+d x\right )}{3 d^3}-\frac {\left (b (d e-c f) \left (d^2 e^2-2 c d e f-\left (3-c^2\right ) f^2\right )\right ) \operatorname {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,c+d x\right )}{3 d^3 f}\\ &=-\frac {b f (d e-c f) x}{d^2}-\frac {b f^2 (c+d x)^2}{6 d^3}-\frac {b (d e-c f) \left (d^2 e^2-2 c d e f-\left (3-c^2\right ) f^2\right ) \tan ^{-1}(c+d x)}{3 d^3 f}+\frac {(e+f x)^3 \left (a+b \tan ^{-1}(c+d x)\right )}{3 f}-\frac {b \left (3 d^2 e^2-6 c d e f-\left (1-3 c^2\right ) f^2\right ) \log \left (1+(c+d x)^2\right )}{6 d^3}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] time = 0.16, size = 118, normalized size = 0.76 \[ \frac {(e+f x)^3 \left (a+b \tan ^{-1}(c+d x)\right )-\frac {b \left (6 d f^2 x (d e-c f)-i (d e-(c-i) f)^3 \log (-c-d x+i)+i (d e-(c+i) f)^3 \log (c+d x+i)+f^3 (c+d x)^2\right )}{2 d^3}}{3 f} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.47, size = 199, normalized size = 1.28 \[ \frac {2 \, a d^{3} f^{2} x^{3} + {\left (6 \, a d^{3} e f - b d^{2} f^{2}\right )} x^{2} + 2 \, {\left (3 \, a d^{3} e^{2} - 3 \, b d^{2} e f + 2 \, b c d f^{2}\right )} x + 2 \, {\left (b d^{3} f^{2} x^{3} + 3 \, b d^{3} e f x^{2} + 3 \, b d^{3} e^{2} x + 3 \, b c d^{2} e^{2} - 3 \, {\left (b c^{2} - b\right )} d e f + {\left (b c^{3} - 3 \, b c\right )} f^{2}\right )} \arctan \left (d x + c\right ) - {\left (3 \, b d^{2} e^{2} - 6 \, b c d e f + {\left (3 \, b c^{2} - b\right )} f^{2}\right )} \log \left (d^{2} x^{2} + 2 \, c d x + c^{2} + 1\right )}{6 \, d^{3}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [F] time = 0.00, size = 0, normalized size = 0.00 \[ \mathit {sage}_{0} x \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.05, size = 283, normalized size = 1.83 \[ \frac {\arctan \left (d x +c \right ) b c \,e^{2}}{d}+\frac {b \,f^{2} \ln \left (1+\left (d x +c \right )^{2}\right )}{6 d^{3}}+\frac {b \,f^{2} \arctan \left (d x +c \right ) x^{3}}{3}+\frac {b \,f^{2} \arctan \left (d x +c \right ) c^{3}}{3 d^{3}}+\frac {a \,f^{2} x^{3}}{3}+\frac {a \,e^{3}}{3 f}-\frac {b \,f^{2} x^{2}}{6 d}-\frac {b \,f^{2} \arctan \left (d x +c \right ) c}{d^{3}}+\arctan \left (d x +c \right ) x b \,e^{2}+\frac {b f \ln \left (1+\left (d x +c \right )^{2}\right ) c e}{d^{2}}+\frac {5 b \,f^{2} c^{2}}{6 d^{3}}+b f \arctan \left (d x +c \right ) e \,x^{2}-\frac {b f \arctan \left (d x +c \right ) e \,c^{2}}{d^{2}}+\frac {b f \arctan \left (d x +c \right ) e}{d^{2}}-\frac {b \,f^{2} \ln \left (1+\left (d x +c \right )^{2}\right ) c^{2}}{2 d^{3}}-\frac {b f e x}{d}+\frac {2 b \,f^{2} c x}{3 d^{2}}+a x \,e^{2}-\frac {b f c e}{d^{2}}+a f \,x^{2} e -\frac {b \,e^{2} \ln \left (1+\left (d x +c \right )^{2}\right )}{2 d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.43, size = 220, normalized size = 1.42 \[ \frac {1}{3} \, a f^{2} x^{3} + a e f x^{2} + {\left (x^{2} \arctan \left (d x + c\right ) - d {\left (\frac {x}{d^{2}} + \frac {{\left (c^{2} - 1\right )} \arctan \left (\frac {d^{2} x + c d}{d}\right )}{d^{3}} - \frac {c \log \left (d^{2} x^{2} + 2 \, c d x + c^{2} + 1\right )}{d^{3}}\right )}\right )} b e f + \frac {1}{6} \, {\left (2 \, x^{3} \arctan \left (d x + c\right ) - d {\left (\frac {d x^{2} - 4 \, c x}{d^{3}} - \frac {2 \, {\left (c^{3} - 3 \, c\right )} \arctan \left (\frac {d^{2} x + c d}{d}\right )}{d^{4}} + \frac {{\left (3 \, c^{2} - 1\right )} \log \left (d^{2} x^{2} + 2 \, c d x + c^{2} + 1\right )}{d^{4}}\right )}\right )} b f^{2} + a e^{2} x + \frac {{\left (2 \, {\left (d x + c\right )} \arctan \left (d x + c\right ) - \log \left ({\left (d x + c\right )}^{2} + 1\right )\right )} b e^{2}}{2 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 0.78, size = 411, normalized size = 2.65 \[ x^2\,\left (\frac {f\,\left (6\,a\,c\,f-b\,f+6\,a\,d\,e\right )}{6\,d}-\frac {a\,c\,f^2}{d}\right )-x\,\left (\frac {2\,c\,\left (\frac {f\,\left (6\,a\,c\,f-b\,f+6\,a\,d\,e\right )}{3\,d}-\frac {2\,a\,c\,f^2}{d}\right )}{d}-\frac {3\,a\,c^2\,f^2+12\,a\,c\,d\,e\,f+3\,a\,d^2\,e^2-3\,b\,d\,e\,f+3\,a\,f^2}{3\,d^2}+\frac {a\,f^2\,\left (3\,c^2+3\right )}{3\,d^2}\right )+\mathrm {atan}\left (c+d\,x\right )\,\left (b\,e^2\,x+b\,e\,f\,x^2+\frac {b\,f^2\,x^3}{3}\right )+\frac {a\,f^2\,x^3}{3}-\frac {\ln \left (c^2+2\,c\,d\,x+d^2\,x^2+1\right )\,\left (36\,b\,c^2\,d^3\,f^2-72\,b\,c\,d^4\,e\,f+36\,b\,d^5\,e^2-12\,b\,d^3\,f^2\right )}{72\,d^6}+\frac {b\,\mathrm {atan}\left (\frac {3\,d^2\,\left (\frac {c\,\left (c^3\,f^2-3\,c^2\,d\,e\,f+3\,c\,d^2\,e^2-3\,c\,f^2+3\,d\,e\,f\right )}{3\,d^2}+\frac {x\,\left (c^3\,f^2-3\,c^2\,d\,e\,f+3\,c\,d^2\,e^2-3\,c\,f^2+3\,d\,e\,f\right )}{3\,d}\right )}{c^3\,f^2-3\,c^2\,d\,e\,f+3\,c\,d^2\,e^2-3\,c\,f^2+3\,d\,e\,f}\right )\,\left (c^3\,f^2-3\,c^2\,d\,e\,f+3\,c\,d^2\,e^2-3\,c\,f^2+3\,d\,e\,f\right )}{3\,d^3} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 10.66, size = 376, normalized size = 2.43 \[ \begin {cases} a e^{2} x + a e f x^{2} + \frac {a f^{2} x^{3}}{3} + \frac {b c^{3} f^{2} \operatorname {atan}{\left (c + d x \right )}}{3 d^{3}} - \frac {b c^{2} e f \operatorname {atan}{\left (c + d x \right )}}{d^{2}} - \frac {b c^{2} f^{2} \log {\left (\frac {c}{d} + x - \frac {i}{d} \right )}}{d^{3}} + \frac {i b c^{2} f^{2} \operatorname {atan}{\left (c + d x \right )}}{d^{3}} + \frac {b c e^{2} \operatorname {atan}{\left (c + d x \right )}}{d} + \frac {2 b c e f \log {\left (\frac {c}{d} + x - \frac {i}{d} \right )}}{d^{2}} - \frac {2 i b c e f \operatorname {atan}{\left (c + d x \right )}}{d^{2}} + \frac {2 b c f^{2} x}{3 d^{2}} - \frac {b c f^{2} \operatorname {atan}{\left (c + d x \right )}}{d^{3}} + b e^{2} x \operatorname {atan}{\left (c + d x \right )} + b e f x^{2} \operatorname {atan}{\left (c + d x \right )} + \frac {b f^{2} x^{3} \operatorname {atan}{\left (c + d x \right )}}{3} - \frac {b e^{2} \log {\left (\frac {c}{d} + x - \frac {i}{d} \right )}}{d} + \frac {i b e^{2} \operatorname {atan}{\left (c + d x \right )}}{d} - \frac {b e f x}{d} - \frac {b f^{2} x^{2}}{6 d} + \frac {b e f \operatorname {atan}{\left (c + d x \right )}}{d^{2}} + \frac {b f^{2} \log {\left (\frac {c}{d} + x - \frac {i}{d} \right )}}{3 d^{3}} - \frac {i b f^{2} \operatorname {atan}{\left (c + d x \right )}}{3 d^{3}} & \text {for}\: d \neq 0 \\\left (a + b \operatorname {atan}{\relax (c )}\right ) \left (e^{2} x + e f x^{2} + \frac {f^{2} x^{3}}{3}\right ) & \text {otherwise} \end {cases} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________